home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts26-11
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: Class Pointer Array (HELP)
- Date: Wed, 06 Mar 96 06:27:28 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4hjb88$elu@sam.inforamp.net>
- References: <4hfs8d$a0@nnrp1.news.primenet.com>
- NNTP-Posting-Host: ts26-11.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <4hfs8d$a0@nnrp1.news.primenet.com>,
- Brad Grossman <bjg@primenet.com> wrote:
- >.....I'm trying to make a program to do the dos DIR function for starters,
- >then use the info for a few things. I made up a class FileData to hold
- >the file info. The prog should work by reading each file, and putting
- >the information into a pointer array of FileData that sorts the
- >information as it is entered. Only thing is, I am using the new operator
- >to create new instances to be pointed to and sorted into the array is not
- >working. I got this same routine to work with integers, but can't get it
- >wo work with the class. Help!!!
-
- Hmmm! I couple suggestions...
-
- #1 Use the predefined container (aka collection) classes provided with
- Borland, Microsoft and other compilers. For Borland you might want to use
- TSArrayAsVector and for Microsoft the alternative would be CObList or
- CObArray. I know the TSArrayAsVector automatically sorts according to the <=
- operator, but I don't know off hand how to sort using MFC collections (i.e.
- never done it in MFC).
-
- #2 If you don't have a predefined container class, then look at the
- design of the Borland and Microsoft container classes and mimic them in your
- environment.
-
- Agrivar
-